package com.jrx.anytxn.transaction.job.paph.step;

import com.jrx.anytxn.transaction.entity.TlServiceFeeLog;
import com.jrx.anytxn.transaction.mapper.ext.ExtTlServiceFeeLogMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DealServiceFeeWriter implements ItemWriter<TlServiceFeeLog> {

    @Resource
    private ExtTlServiceFeeLogMapper extTlServiceFeeLogMapper;

    @Override
    public void write(List<? extends TlServiceFeeLog> items) throws Exception {
        if(CollectionUtils.isNotEmpty(items)){
            extTlServiceFeeLogMapper.batchInsert((List<TlServiceFeeLog>) items);
        }
    }
}
